<!DOCTYPE html>
<html>
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>鑫源东恒后台管理系统</title>
    <link rel="shortcut icon" href="/public/favicon.ico">
    <link href="__MANAGE__/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="__MANAGE__/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="__MANAGE__/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__MANAGE__/css/animate.min.css" rel="stylesheet">
    <link href="__MANAGE__/css/style.min862f.css?v=4.1.0" rel="stylesheet">


</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeIn">
    <div class="row">
        <div class="col-sm-12">
            <div class="tabs-container">
                <ul class="nav nav-tabs">
                    <li class="{if condition=" input('tab',1) eq 1"}active{/if}"><a data-toggle="tab" href="#tab-1" aria-expanded="true">管理员列表</a>
                    </li>
                    <li class="{if condition=" input('tab',1) eq 2"}active{/if}"><a data-toggle="tab" href="#tab-2" aria-expanded="false">新增管理员</a>
                    </li>
                    <li id="showtab" class="{if condition=" input('tab',1) eq 3"}active{/if}"><a data-toggle="tab" href="#tab-3" aria-expanded="false"
                                                   style="{if condition=" input('tab',1) neq 3"}display:none;{/if}">编辑管理员</a>
                    </li>
                </ul>
                <div class="tab-content">
                    <div id="tab-1" class="tab-pane {if condition=" input('tab',1) eq 1"}active{/if}">
                    <div class="panel-body">
                        <form method="post" class="form-horizontal" action="{:url('brand/index')}"
                              data-type="ajax">
                            <input type="hidden" name="tab" value="1">
                            <div class="row">
                                <div class="col-sm-12">
                                    <div class="ibox float-e-margins">
                                        <div class="ibox-content">
                                            <div class="table-responsive">
                                                <table class="table table-striped">
                                                    <thead>
                                                    <tr>
                                                        <th width="10%">ID</th>
                                                        <th width="20%">管理员名称</th>
                                                        <th width="20%">联系方式</th>
                                                        <th width="20%">启用状态</th>
                                                        <th width="10%">最后登录IP</th>
                                                        <th width="10%">操作</th>
                                                    </tr>
                                                    </thead>
                                                    <tbody>
                                                    {volist name="managelist" id="vo"}
                                                    <tr>
                                                        <td>{$vo.id}</td>
                                                        <td>{$vo.manage_name}</td>
                                                        <td>{$vo.manage_mobile}</td>
                                                        <td>
                                                            {if condition="$vo.manage_status eq 1"}
                                                            <button class="btn btn-primary dim setState"
                                                                    data-id="{$vo.id}" type="button">在线
                                                            </button>
                                                            {else/}
                                                            <button class="btn btn-default dim setState"
                                                                    data-id="{$vo.id}" type="button">离线
                                                            </button>
                                                            {/if}
                                                        </td>
                                                        <td>{$vo.manage_lip}</td>
                                                        <td>
                                                            <a href="{:url('index',['tab'=>3,'id'=>$vo.id])}">
                                                                <button type="button" class="btn btn-info" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="管理">
                                                                    <i class="fa fa-edit"></i>
                                                                </button>
                                                            </a>&nbsp;&nbsp;
                                                            <a name="delete" href="{:url('del',['id'=>$vo.id])}">
                                                                <button type="button" class="btn btn-danger" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="删除">
                                                                    <i class="fa fa-trash-o "></i>
                                                                </button>
                                                            </a>
                                                        </td>
                                                    </tr>
                                                    {/volist}
                                                    </tbody>
                                                </table>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <div id="tab-2" class="tab-pane {if condition=" input('tab',1) eq 2"}active{/if}">
                <div class="panel-body">
                    <form method="post" class="form-horizontal" action="{:url('manage/index')}"
                          data-type="ajax">
                        <input type="hidden" name="tab" value="2">
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">管理员名称</label>
                            <div class="col-sm-10">
                                <input type="text" name="manage_name" class="form-control" value="">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">管理员密码</label>

                            <div class="col-sm-10">
                                <input type="number" name="manage_pwd" class="form-control" value="">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">管理员联系方式</label>

                            <div class="col-sm-10">
                                <input type="number" name="manage_mobile" class="form-control" value=""
                                       placeholder="请正确填写联系方式">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">管理员邮箱</label>
                            <div class="col-sm-10">
                                <input type="text" name="manage_email" class="form-control" value="">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">启用状态</label>
                            <div class="col-sm-10">
                                <div class="radio i-checks col-sm-4">
                                    <label class="radio-inline">
                                        <input type="radio" checked="" value="1"
                                               id="optionsRadios1" name="manage_status">启用</label>
                                    <label class="radio-inline">
                                        <input type="radio" value="2"
                                               id="optionsRadios2" name="manage_status">禁用</label>
                                </div>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <button class="btn btn-primary" type="submit">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
            <div id="tab-3" class="tab-pane {if condition=" input('tab',1) eq 3"}active{/if}">
            <div class="panel-body">
                <form method="post" class="form-horizontal" action="{:url('manage/edit')}"
                      data-type="ajax">
                    <input type="hidden" name="tab" value="3">
                    <input type="hidden" name="id" value="{$manage_info.id}">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">管理员名称</label>

                        <div class="col-sm-10">
                            <input type="text" name="manage_name" class="form-control"
                                   value="{$manage_info.manage_name}">
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">管理员密码</label>

                        <div class="col-sm-10">
                            <input type="number" name="manage_pwd" class="form-control" value="" placeholder="留空不修改">
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">管理员联系方式</label>
                        <div class="col-sm-10">
                            <input type="number" name="manage_mobile" class="form-control"
                                   value="{$manage_info.manage_mobile}">
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">管理员邮箱</label>
                        <div class="col-sm-10">
                            <input type="text" name="manage_email" class="form-control"
                                   value="{$manage_info.manage_email}">
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">管理员状态</label>
                        <div class="col-sm-10">
                            <div class="radio i-checks col-sm-4">
                                <label class="radio-inline">
                                    <input type="radio" {if condition="$manage_info.manage_status eq 1" }checked{/if}
                                    value="1" id="optionsRadios1" name="manage_status">激活状态</label>
                                <label class="radio-inline">
                                    <input type="radio" {if condition="$manage_info.manage_status eq 2" }checked{/if}
                                    value="2" id="optionsRadios2" name="manage_status">冻结状态</label>
                            </div>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <div class="col-sm-4 col-sm-offset-2">
                            <button class="btn btn-primary" type="submit">提交</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
</div>
</div>
<script src="__MANAGE__/js/jquery.min.js?v=2.1.4"></script>
<script src="__MANAGE__/js/bootstrap.min.js?v=3.3.6"></script>
<script src="__MANAGE__/js/content.min.js?v=1.0.0"></script>
<script src="__MANAGE__/js/plugins/iCheck/icheck.min.js"></script>
<script>
    $(document).ready(function () {
        $(".i-checks").iCheck({checkboxClass: "icheckbox_square-green", radioClass: "iradio_square-green",})
    });
    $(function () { $("[data-toggle='tooltip']").tooltip(); });
</script>
<script src="__MANAGE__/js/plugins/layer/layer.min.js"></script>
<script src="__MANAGE__/js/layer_alert.js"></script>
<script src="__MANAGE__/layui/layui.js" charset="utf-8"></script>
<script>
    $(document).ready(function () {
        $(".i-checks").iCheck({checkboxClass: "icheckbox_square-green", radioClass: "iradio_square-green",})
        $('.setState').on('click', function () {
            var id = $(this).data('id');
            layer.confirm('确定要改变吗？', {
                btn: ['确定', '放弃'] //按钮
            }, function () {
                $.ajax({
                    type: 'POST',
                    url: '{:url("manage/status")}',
                    data: {
                        'id': id
                    }, success: function (res) {
                        if (res == 1) {
                            layer.alert('成功', {icon: 6});
                            setTimeout(function () {
                                window.location.reload();
                            }, 1000);
                        }
                    }
                });
            }, function () {
                layer.msg('有待处理', {
                    time: 1000, //1s后自动关闭
                });
            });
        });
    });
</script>
</body>
</html>
